﻿<UserControl
	x:Class="MVVMtutorial.MainPage"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:me="clr-namespace:MVVMtutorial" 
	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
	xmlns:MVVMSL="clr-namespace:Riba.MVVMSL;assembly=RibaMVVMSL" 
	mc:Ignorable="d" d:DesignHeight="200" d:DesignWidth="500"
>
	<UserControl.DataContext>
		<me:MainPageViewModel />
	</UserControl.DataContext>

	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="24" />
			<RowDefinition />
			<RowDefinition Height="24" />
		</Grid.RowDefinitions>

		<MVVMSL:ViewEventHandlerControl />

		<StackPanel Orientation="Horizontal">
			<Button
				Content="Show MessageBox"
				Command="{Binding CommandShowMessageBox}"
			/>
			<Button
				Content="Show MessageWindow"
				Command="{Binding CommandShowMessageWindow}"
			/>
			<Button
				Content="Open File Dialog"
				Command="{Binding CommandOpenFileDialog}"
			/>
			<Button
				Content="Dialog1"
				Command="{Binding CommandDialog}"
				CommandParameter="Dialog1"
			/>
			<Button
				Content="Dialog2"
				Command="{Binding CommandDialog}"
				CommandParameter="Dialog2"
			/>
			<Button
				Content="Dialog3"
				Command="{Binding CommandDialog}"
				CommandParameter="Dialog3"
			/>
		</StackPanel>

		<StackPanel Grid.Row="2" Orientation="Horizontal">
			<Border Width="140" Background="Coral" HorizontalAlignment="Left">
				<TextBlock Text="Move mouse over">
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="MouseEnter">
								<i:InvokeCommandAction
									Command="{Binding CommandMouseEnter}" 
									CommandParameter="123"
								/>
							</i:EventTrigger>
						</i:Interaction.Triggers>
				</TextBlock>
			</Border>

			<TextBlock Text="Status: " />
			<TextBlock Text="{Binding NotificationFromDialog2}" />
		</StackPanel>

		<MVVMSL:NavigatorControl
			Grid.Row="1"
			IsDirtyQuestion="Sie haben Änderungen. Wollen Sie diese speichern?"
			IsDirtyQuestionCaption="Änderungen"
			ContinueNavigationButtonCaption="Nicht speichern"
			CancelNavigationButtonCaption="Zurück zum Speichern"
		/>
	</Grid>
</UserControl>